import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { PayActivityRegistrationForm, PayActivityRegistrationQuery, PayActivityRegistrationVo } from '@/api/pay/model/activityRegistrationModel';
import { request } from '@/utils/request';

// 查询活动报名列表
export function listActivityRegistration(query?: PayActivityRegistrationQuery) {
  return request.get<TableDataInfo<PayActivityRegistrationVo>>({
    url: '/pay/activityRegistration/list',
    params: query,
  });
}

// 查询活动报名详细
export function getActivityRegistration(registrationId: number) {
  return request.get<R<PayActivityRegistrationVo>>({
    url: `/pay/activityRegistration/${registrationId}`,
  });
}

// 新增活动报名
export function addActivityRegistration(data: PayActivityRegistrationForm) {
  return request.post<R<void>>({
    url: '/pay/activityRegistration',
    data,
  });
}

// 修改活动报名
export function updateActivityRegistration(data: PayActivityRegistrationForm) {
  return request.put<R<void>>({
    url: '/pay/activityRegistration',
    data,
  });
}

// 删除活动报名
export function delActivityRegistration(registrationIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/pay/activityRegistration/${registrationIds}`,
  });
}
